- content_for(:title, @app.name)
- content_for(:body_id, 'manage_flow')

%script#new_category_template{type: 'text/x-handlebars-template'}
  = render 'new_category'
%script#service_template{type: 'text/x-handlebars-template'}
  = render 'application_service_row', { presenter: JsonServiceRowPresenter.new() }
%script#category_archetype{type: 'text/x-handlebars-template'}
  = render 'category_panel', { presenter: JsonCategoryPresenter.new() }

%header.application
  = render '/shared/breadcrumbs', breadcrumbs: ['Manage',
                                                link_to('Dashboard', dashboard_index_path),
                                                link_to('Applications', apps_path),
                                                yield(:title)]
%section.deployment-details
  %ul.deployment-env
    %li
      %strong Deployed to:
      CoreOS Local
    %li
      =link_to('Documentation', '#', { class: 'instructions-dialog', data: { 'doc-url'=> documentation_app_path(@app.id) } })  if @app.documentation.present?
    %li
      %span{ class: 'application-access' }
        Access your application
        .context-help
          %section.tooltip
            %aside.arrow
            %span{ class: 'dismiss' }
            %p
              If your application has a GUI, map a port on your local host machine to the port bound to the CoreOS host.
            %p
              = succeed '.' do
                %a{href:'https://github.com/CenturyLinkLabs/panamax-ui/wiki/How-To%3A-Port-Forwarding-on-VirtualBox'}Go to our wiki for instructions
      = link_to("Inspect #{@app.name} on imagelayers.io", @app.imagelayers_url, title: "View #{@app.name} on imagelayers.io", target: '_blank', class:'imagelayers-link-with-text')

  = render 'application_button_menu', app: @app

%section.application-services{data: { source: app_services_path(@app.id, format: :json) } }
  %header
    %h3
      Application Services
    %nav
      %a.list.selected{ title: 'category view' }
      %a.relationship{ title: 'relationship view' }
  .views
    .categories
      - @app.categorized_services.each do |group, services|
        = render 'category_panel', { presenter: CategoryPresenter.new(@app, group, services) }
      .category-panel.add
        %header
          %span.title
            Add a Category
        %button.button-positive.add-category
    .relationships
      = render 'relationship_view', :app => @app

= render 'shared/journal',
  title: 'CoreOS Journal - Application Activity Log',
  journal_path: journal_app_path(@app.id, format: :json)

= render 'services/add_service'
#post-run-html
  = @app.documentation_to_html.html_safe if @app.documentation.present?
